package com.atguigu.yygh.hosp.service.impl;

import com.atguigu.yygh.hosp.entity.HospitalSet;
import com.atguigu.yygh.hosp.mapper.HospitalSetMapper;
import com.atguigu.yygh.hosp.service.HospitalSetService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 医院设置表 服务实现类
 * </p>
 *
 * @author atguigu
 * @since 2022-10-31
 */
@Service
public class HospitalSetServiceImpl extends ServiceImpl<HospitalSetMapper, HospitalSet> implements HospitalSetService {

    @Override
    public void removeHospSetByIds (List<Long> idList) {
        for (Long id : idList) {
            this.updateById (this.getById (id).setIsDeleted (1));
        }
    }

    @Override
    public void lockHospitalSet (Long id, Long statusId) {
        HospitalSet hospitalSet = this.getById (id);
        hospitalSet.setStatus (statusId.intValue ());
        this.updateById (hospitalSet);
    }
}
